import React from 'react';
import {getCurrentMonth,onMenu} from '../utils/tools';
import { connect } from 'dva';
import { appname } from '../config';

export default connect()(class Menu extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			display: 'none',
		};
		this.onClick = () => {
			this.setState({ display: 'block' });
		}
		this.muskClick = () => {
			this.setState({ display: 'none' });
		}
	}
	render() {
		let style = {
			display: this.state.display
		};
		return (
			<div>
				<div onClick={this.onClick} className="m_header_option"></div>
				<div className="menu" style={style}>
					<ul>
						<li onClick={() => { onMenu("/",dispatch) } }><img src="img/icon_home.png" /><span>首页</span></li>
						<li className="menu_divider"></li>
						<li onClick={() => { onMenu("/bank",dispatch) } }><img src="img/icon_bank.png" /><span>存款</span></li>
						<li className="menu_divider"></li>
						<li onClick={() => { onMenu("/income",dispatch) } }><img src="img/icon_income.png" /><span>收入</span></li>
						<li className="menu_divider"></li>
						<li onClick={() => { onMenu("/outlay",dispatch) } }><img src="img/icon_cost.png" /><span>开支</span></li>
					</ul>
				</div>
				<div className="menu_musk" style={style} onClick={this.muskClick}>

				</div>
			</div>
		);
	}
}
)